package j12;

import j17.User;

import java.util.concurrent.atomic.AtomicReference;

/**
 * @author chengshuai
 * @date 2021/4/9 21:14
 */
public class Test {

    public static void main(String[] args) {
        User z3 = new User("z3", 22);
        User li4 = new User("li4", 25);
        AtomicReference<User> atomicReference = new AtomicReference<>();
        atomicReference.set(z3);
        System.out.println(atomicReference.compareAndSet(z3, li4));
        System.out.println(atomicReference.compareAndSet(z3, li4));

        System.out.println(1);
    }
}
